package com.wendy.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wendy.utils.date.DateTimeJsonDeserializer;
import com.wendy.utils.date.DateTimeJsonSerializer;
import lombok.Data;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * @author zhuwending
 */
@Data
public abstract class BaseModel implements Serializable {

    @Column(name = "DELETED")
    private Boolean deleted = false;
    @Column(name = "CREATE_TIME")
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    @JsonDeserialize(using = DateTimeJsonDeserializer.class)
    private Date createTime;
    @Column(name = "CREATE_USER")
    private String createUser;
    @Column(name = "UPDATE_TIME")
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    @JsonDeserialize(using = DateTimeJsonDeserializer.class)
    private Date updateTime;
    @Column(name = "UPDATE_USER")
    private String updateUser;
}
